""" 
@coding  : utf-8
@Time    : 2023/4/20 15:56
@Author  : Rumou
@File    : log_IP统计.py
@Description: 统计scwebsite2_ssl.log文件中总共有多少个ip访问过
"""
with open("scwebsite2_ssl.log", "r") as fp:
    log = fp

    ip_lists = {}
    for line in log:
        current_line = line.split()
        for i in current_line:
            ip = current_line[0]
            if ip not in ip_lists:
                ip_lists[ip] = 1
            else:
                ip_lists[ip] = ip_lists[ip] + 1
    print(len(ip_lists))
